The invention relates to a method for image acquisition actuated by a system for image acquisition provided with optical devices for image acquisition of the digital camera type, in particular fixed optical devices.
In the present description and in the subsequent claims the expression “optical device for image acquisition” is intended for a device capable of acquiring images of an object and particularly optical information associated with an object placed on a supporting plane, e.g. object identifying data, such as, for example, an optical code associated with the object.
The expression “optical information” is intended for any graphical representation constituting a coded or non-coded information. A particular example of optical information consists of linear or bi-dimensional optical codes, wherein the information is coded by means of suitable combinations of elements of predetermined shape, for example squares, rectangles or hexagons of dark colour (normally black) separated by clear elements (spaces, normally white) such as barcodes, stacked codes and bi-dimensional codes in general, colour codes, etc. The expression “optical information” further comprises, more generally, also other graphical shapes, including printed or handwritten characters (letters, numbers, etc.) and particular shapes (so-called “patterns”), such as, for example, stamps, logos, signatures, fingerprints, etc. The expression “optical information” also comprises graphical representations detectable not only in the range of visible light, but also in the entire range of wavelength comprised between infrared and ultraviolet.
It is known from the prior art to use, in systems for image acquisition, linear digital cameras comprising (linear) mono-dimensional arrays of photosensors, in particular of the CCD or C-MOS type, to acquire images of parcels, or objects in general, travelling on a conveyor belt, or on other movement and conveying systems, and to read through said linear digital cameras the optical information printed or affixed thereupon. Hereinafter, said linear digital cameras will be described more concisely as linear cameras. The expression “fixed optical device for image acquisition” is intended for an optical device for image acquisition that is used without human operation (so-called “unattended scanner”). The object detection typically comprises reading an optical and/or character code.
The systems for image acquisition known from the prior art typically comprise at least one linear camera and a lamp or solid state lighting system. In most cases, then, one or more reflecting mirrors are present. These components can be housed in a common container or in separated containers.
The linear camera has the function of collecting the image from which the information for identifying an object has to be extracted. This image can be the image of the object as a whole or of an optical code—as defined above—contained therein. The image acquisition occurs by means of a suitable optical system and a dedicated optoelectronics and electronics, wherein an optical sensor exists consisting of a CCD or a C-MOS of linear type comprising an array of photosensitive elements (also called pixels).
The image is acquired by storing subsequent scans, each of which represents a very thin “line” of the whole image. The movement of the supporting plane, or of the object, at the fixed reading station, enables successive lines of the image to be acquired and, then, the complete image to be acquired. The lighting system enables the acquisition zone to be lighted with the appropriate light levels and lighting angles.
The deflecting mirror, or deflecting mirrors, enables the installation of the device for image acquisition to be optimised from the point of view of the occupied space with respect to the conveying device of the objects and thus enables the field of view of the linear camera (defined below), and possibly also the beam of light emitted by the lighting system, to be oriented to the desired area.
As already said, the linear camera acquires the image of the object row by row and transmits the image to a decoder, which can be separated from the linear camera, or integrated therein, and which reconstructs the image acquired by the linear camera by assembling all the rows and then processes the image in order to extract (decode) the information of the optical codes and/or other optical information, or to send the information and make the information available to a further processing apparatus. The decoding algorithm performs a bi-dimensional analysis of the acquired images whereby a code, or a sequence of characters can be properly read, which has any orientation. For this reason, systems of linear cameras having linear sensors are considered omnidirectional acquiring and reading systems.
The image acquisition is controlled by a microprocessor that, typically, is contained in the linear camera, but can also be external and connected thereto. The microprocessor receives information from external sensors, such as, for example, object height sensors, object presence sensors, distance sensors, speed sensors, and exploits this information to adjust the operating parameters of the linear camera, such as, for example, sensitivity, position of an autofocus system, scanning frequency, etc.
In order to be able to acquire images and read optical information over a wide range of linear camera-object distances, as it is typical for industrial applications (for example for identifying and sorting parcels), it is usual to provide the linear camera with an autofocus system in which the optical receiving system (or part thereof), or the sensor, moves to modify the focus parameters of the linear camera and enable optical information to be read on objects of different shapes and sizes. Usually, the autofocus system of the linear camera “follows” the shape of the objects on the basis of the information about the height provided by the height or distance sensors such as, for example, photocell barriers.
The expression “depth of field” is used herein to indicate the range of linear camera-object distances, in a neighbourhood of the distance of perfect focus that is set each time by the autofocus system, wherein the object is sufficiently focused to enable the optical information to be read.
As indicated above, the linear camera needs some essential information for properly setting its operating parameters, in order to acquire the optical information associated with the moving objects.
In particular, the linear camera has to know the speed of the objects. Usually, if, for example, the conveying device is a conveyor belt or a plate conveyor a speed sensor is associated therewith, that can be, for example, an optical encoder that generates a square wave, the frequency of which is proportional to the belt speed. The encoder is in fact a belt advance sensor, from which the movement speed of the belt and thus also of the objects is obtained by derivation. The speed of the conveyor belt is also used to define the position of the objects on the conveyor belt.
Determining the position of each object on the conveyor belt is necessary to avoid assigning a code of an object to another object, this in order to enable a correct traceability of the objects.
Further, determining the position of each object on the conveyor belt is necessary for focusing each linear camera in the correct point, in particular when a code has to be read that is located on a front face of the objects.
For a correct and efficient operation of the autofocus system, the linear camera also has to know the height of the objects or, if it is a linear camera designed for reading codes on a side face of the objects, it has to know the lateral position of the objects, i.e. the distance of the objects from the edges of the supporting plane. Height and distance sensors are then provided, such as, for example, photocell barriers and laser sensors that measure the time of flight of the emitted laser beam, said sensors being placed upstream the linear camera or cameras.
The linear camera must especially know when acquisition of the sequence of rows, or lines, constituting the image (so-called ‘frame’) has to be started, and how long acquisition has to last. In systems with a plurality of linear cameras it is furthermore necessary that every object has the same identification for all the linear cameras. For this reason, all the linear cameras of the system share the same source of “frame trigger” for starting the acquisition of the sequence of rows.
This source is typically a presence sensor (for example a photocell) that detects the presence of an object on a horizontal line that is perpendicular to the direction of the conveyor belt and generates the signal of “frame trigger”. Alternatively, the height sensor can be provided as the device of “frame trigger”. The signal of “frame trigger” is generated when the measured height exceeds a certain preset threshold.
The start and the end of the “frame” acquisition are determined from a start/stop signal generated by the “frame trigger” device. However, acquisition does not start as soon as the “frame trigger” device detects an object, but starts with a delay that is preset for every linear camera of the system, a delay that depends on the distance between the “frame trigger” device and the view line of the linear camera on the belt plane, on the view angle of the linear camera, on the speed of the objects, on the measured height thereof and/or on the measured distance thereof from the edges of the supporting plane and/or on the overall dimensions thereof along the direction of the conveyor belt. All the sensors disclosed above can be physically connected to the linear camera(s) or to a control device that processes the information and “distributes” the information to the linear camera(s).
The control device controls all the sensors and can also control the lighting devices.
The information provided by the sensors is distributed to the linear cameras and every camera, on the basis of this information and the positioning of the linear camera itself, adapts its own acquisition parameters.
In particular, each linear camera, on the basis of the information on the speed of the objects, adjusts its own acquisition frequency (or scanning frequency, i.e. the number of lines acquired per second).
A method for image acquisition that is used in prior art acquisition systems calculates the position of the object on the conveyor belt, determining the average speed of the conveyor belt in a preset range. As the space S through which an object travels in a period T of the encoder is constant, the average speed Vm can be measured by simply dividing the space travelled in a preset number of periods T of the encoder by the total duration of said periods, i.e. Vm=nS/(T1+T2+ . . . Tn). A first calculation of the average speed is made in the range between the “frame trigger” and the start of image acquisition. Subsequently, after the start of image acquisition, the value of the average speed is recalculated for each encoder period, in such a manner as to adapt the image acquisition parameters to possible variations of said average speed. This method for image acquisition also adjusts the scanning frequency of each linear camera on the basis of the average speed of the conveyor belt, calculated as specified above. This method for image acquisition is used, in particular, if the resolution of the encoder available on the conveyor belt is rather poor.
A drawback of this method for image acquisition is that the advance speed of the object on the conveyor belt, i.e. the speed of the conveyor belt, detected on the basis of the period of the encoder, as disclosed above, does not necessarily reflect the actual speed of the conveyor belt at the moment in which image acquisition starts.
In other words, the speed calculated for establishing the scanning frequency of the linear camera in acquiring a line of image does not represent the instantaneous speed of the conveyor belt at the moment in which scanning frequency is adjusted, but an average speed calculated over a period of time preceding the moment of acquisition of said line of image.
Consequently, when adjusting the scanning frequency, it is assumed that the speed of the belt remains constant even for a period of time after the period in which it is detected, i.e. when scanning of the line of image starts.
A deviation of the calculated value of the speed of the conveyor belt, used to establish the scanning frequency with respect to the actual value of the speed at the moment of acquisition of a row of image, determines an incorrect calculation of the acquisition parameters of the linear camera and distorted acquisition of the row of image, which can lead, if it is repeated for a high number of rows of the image to be acquired, to a poor quality image that cannot be decoded correctly.
In particular, the relations between the parameters of the linear camera and the conditions of the line of the conveyor belt are set out below: the acquisition period, and, thus, acquisition frequency, depends on the speed of the objects and can also depend on the height of the objects; and the sensitivity and position of the focus of the linear camera depend on the distance or height of the objects (high objects are normally more lighted).
This means, as already said, that, if the parameters of the linear camera are not correctly adapted to the instantaneous speed of the conveyor belt, there is the risk of acquiring distorted images of the codes or of not acquiring the images at all.
Further, a deviation of the speed of the conveyor belt with respect to the actual speed causes an incorrect calculation of the position of the object on the conveyor belt, entailing the risk of assigning a code of an object to another object, when the data relating to the images are transmitted to a host and, for traceability, it is ascertained which code/s is/are applied to a determined object.
This drawback is particularly accentuated in the event of sudden accelerations/decelerations that occur over the lapse of time in which it is assumed that the speed of the belt remains the speed calculated in the last period of the interval of time of acquisition of the belt speed.
The aforesaid method for image acquisition is thus rather approximate and only suitable for conveyor belts that always move at a substantially constant speed, further, in this method there is not provided the possibility of a temporary stop of the conveyor belt. In this latter case, in fact, in the neighbourhood of the stopping point the detected images would certainly be distorted, because of the fact that the speed of the belt tends to vary very rapidly, both during the deceleration step before the stop and during the restart step after the stop and it is thus not possible to calculate correctly the scanning frequency of the linear camera in the aforesaid steps.
An object of the invention is to overcome the drawbacks of known methods for image acquisition.
Another object of the invention is to provide a method for image acquisition that, once it has been implemented, enables correct images to be acquired in any operating condition of a supporting plane on which an object transits that has “optical information” to be acquired.
A further object of the invention is to provide a method for image acquisition that, once it has been implemented, enables the parameters of a linear camera to be set, said linear camera having to acquire images of the object in the manner that conforms as closely as possible to the actual advance conditions of the supporting plane.
According to the invention a method for image acquisition is provided as defined in claim 1.
Owing to the invention, it is possible to obtain a method of image acquisition that enables the parameters of the linear camera to be set in function of the actual conditions of the supporting plane and also regardless of the speed thereof.
Further, the method according to the invention enables it to be avoided that the photosensors of the linear camera become saturated, thereby preventing correct acquisition of the codes to be detected.